<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
</html>
<script>
    var str = "fsfsdfsrt"
    function fn(str1,target){
        if(target===str.substr(-1)){
            return true
        }else{
            return false
        }

    }
    fn(str,'t')
    console.log(fn(str,'t'));
    
</script>